package unit2;

import java.util.Scanner;
public class Ex2_8_SwitchDemo {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输月份：");
        int month = in.nextInt(); // 输入月份
        String season;
        switch (month) {
        case 12:
        case 1:
        case 2:
            season = "冬季";
            break;
        case 3:
        case 4:
        case 5:
            season = "春季";
            break;
        case 6:
        case 7:
        case 8:
            season = "夏季";
            break;
        case 9:
        case 10:
        case 11:
            season = "秋季";
            break;
        default:
            season = "月份输入有误！";
        }
        System.out.println(month + "月，属于 " + season + "。");
    }

}
